
package me.zhengjie.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.hibernate.annotations.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author IQW
* @date 2022-07-03
**/
@Entity
@Data
@Table(name="app_work")
public class AppWork implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "work_id")
    @ApiModelProperty(value = "任务ID")
    private Integer workId;

    @Column(name = "area_id")
    @ApiModelProperty(value = "责任区ID")
    private Integer areaId;

    @Column(name = "config_id")
    @ApiModelProperty(value = "配置ID")
    private Integer configId;

    @Column(name = "user_id")
    @ApiModelProperty(value = "分配用户ID")
    private Integer userId;

    @Column(name = "title")
    @ApiModelProperty(value = "标题")
    private String title;

    @Column(name = "label")
    @ApiModelProperty(value = "类型（1临时巡护，2日常巡护，3紧急巡护）")
    private String label;

    @Column(name = "jjcd")
    @ApiModelProperty(value = "紧急程度")
    private String jjcd;

    @Column(name = "address")
    @ApiModelProperty(value = "目的地")
    private String address;

    @Column(name = "lon")
    @ApiModelProperty(value = "目的地经度")
    private Double lon;

    @Column(name = "lat")
    @ApiModelProperty(value = "目的地纬度")
    private Double lat;

    @Column(name = "note")
    @ApiModelProperty(value = "描述")
    private String note;

    @Column(name = "imgs")
    @ApiModelProperty(value = "图片")
    private String imgs;

    @Column(name = "voice")
    @ApiModelProperty(value = "录音")
    private String voice;

    @Column(name = "vtime")
    @ApiModelProperty(value = "录音时长")
    private Integer vtime;

    @Column(name = "work_time")
    @ApiModelProperty(value = "已行驶时长（秒）")
    private Integer workTime;

    @Column(name = "work_mile")
    @ApiModelProperty(value = "已行驶里程（米）")
    private Float workMile;

    @Column(name = "start_time")
    @ApiModelProperty(value = "巡护开始时间")
    private Timestamp startTime;

    @Column(name = "end_time")
    @ApiModelProperty(value = "巡护结束时间")
    private Timestamp endTime;

    @Column(name = "status")
    @ApiModelProperty(value = "状态（0未开始，1巡护中，2已完成）")
    private Integer status;

    @Column(name = "create_time")
    @CreationTimestamp
    @ApiModelProperty(value = "创建日期")
    private Timestamp createTime;

    @Column(name = "update_time")
    @UpdateTimestamp
    @ApiModelProperty(value = "更新日期")
    private Timestamp updateTime;


    public void copy(AppWork source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(false));
    }
}